package org.ilovecode.display {
	
	import flash.display.DisplayObject;
	import flash.display.MovieClip;
	import flash.geom.ColorTransform;
	import org.ilovecode.config.Definitions;
	import org.ilovecode.Utilities;
	
	/**
	 * ...
	 * @author Vjekoslav Ratkajec
	 */
	public class FloorLayoutBaseRoom extends MovieClip {
		
		private var _status:String = "";
		private var _price:String = "";
		private var _code:String = "";
		private var _id:String = "";
		private var _instance:DisplayObject;
		
		public function FloorLayoutBaseRoom(instance:DisplayObject, id:String, code:String, status:String, price:String) {
			_instance = instance;
			_id = id;
			_code = code;
			_status = status;
			_price = Utilities.getMoney(Number(price), 2);
			
			var color:uint = 0;
			switch(status) {
				case "stan za prodaju":
					color = Definitions.FOR_SALE_COLOR;
					break;
				case "prodano":
					color = Definitions.SOLD_COLOR;
					break;
				case "rezervirano":
					color = Definitions.RESERVED_COLOR;
					break;
			}
			var ct:ColorTransform = new ColorTransform();
			ct.color = color;
			_instance.transform.colorTransform = ct;
			_instance.alpha = 0;
		}
		
		public function get instance():DisplayObject {
			return _instance;
		}
		
		public function get status():String {
			return _status;
		}
		
		public function get price():String {
			return _price;
		}
		
		public function get code():String {
			return _code;
		}
		
		public function get id():String {
			return _id;
		}
		
	}

}